<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>{{$chubanzengshu->biaoti}}-夜读书</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="author" content="夜读书">
    <meta name="description" content="{{$chubanzengshu->biaoti}}">
    <meta name="keywords" content="赠书活动，出版社，出版公司，夜读书文化联盟，读书,阅读,小说,文学">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{{ asset('/bootstrap-3.3.5-dist/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/hangye.css') }}">
    <script src="{{ asset('/scripts/jquery/jquery-1.11.3.min.js') }}"></script>
    <script src="{{ asset('/bootstrap-3.3.5-dist/js/bootstrap.min.js') }}"></script>
    {{-- umeditor --}}
    <script type="text/javascript" charset="utf-8" src="{{asset('/editor/ueditor1_4_3_3/ueditor.config.js')}}"></script>
    <script type="text/javascript" charset="utf-8" src="{{asset('/editor/ueditor1_4_3_3/ueditor.all.js')}}"> </script>
    <script type="text/javascript" charset="utf-8" src="{{asset('/editor/ueditor1_4_3_3/lang/zh-cn/zh-cn.js')}}"></script>
    {{-- umeditor end--}}
</head>
<body onload="theLocation();">
    @include('hangye.include.header')
    <div id="detail" style="background: #ffffff;">
        <div class="site-wrapper">
            <div class="zsmain">
                <div class="vbiaoti">{{$chubanzengshu->biaoti}}</div>
                <div class="vtime">{{date('Y-m-d H:i',$chubanzengshu->add_time)}}</div>
                <div class="vbook">
                <a href="{{url('info/' .  $chubanzengshu->books->book_id)}}" target="_blank">
                    <div class="booksbox">
                        <img class="bimg" style="float:left;" src="{{url($chubanzengshu->books->bimg)}}" />
                        <dl style="margin-left: 140px;">
                            <dt class="vbooktitle">{{$chubanzengshu->books->book_name}}</dt>
                            <dt class="vbookdesc">
                                @if($chubanzengshu->books->zuozhe!=""){{ $chubanzengshu->books->zuozhe }} /@endif 
                                @if($chubanzengshu->books->yizhe!=""){{ $chubanzengshu->books->yizhe }} / @endif 
                                @if($chubanzengshu->books->chubanshe!=""){{ $chubanzengshu->books->chubanshe }} /@endif 
                                @if($chubanzengshu->books->chubannian!=""){{ $chubanzengshu->books->chubannian }} /@endif
                                @if($chubanzengshu->books->dingjia!=""){{ $chubanzengshu->books->dingjia }}元@endif
                            </dt>
                        </dl>
                    <div style="clear:both"></div>
                    </div>
                </a>
                </div>
                <div class="vjieshao">{!!$chubanzengshu->jieshao!!}</div>                
                <!-- 文章底部评论信息 -->
                @if(Session::has('name')) 
                <div class="new-comment" style="padding-top:15px;">
                <form name="form" class="form-horizontal" role="form" method="post" action="" enctype="multipart/form-data">
                <input type="hidden" name="_token" value="{{ csrf_token() }}" />
                    <div class="avatar">
                        @if($user->avatar_file_min!="")
                            <img src="{{url($user->avatar_file_min)}}">
                        @else
                            <img src="http://www.yedushu.com/usersface/default/avatar-min.png">
                        @endif
                    </div>
                    <div class="zsliuyan">
                        <script type="text/plain" id="zsliuyan" name="zsliuyan" style="width:100%;"></script>
                    </div>
                    <button type="button" id="okbutton" class="btn btn-success" style="float:right;margin-top:30px;">发表回应</button>
                </form>
                </div>
                @else              
                <div class="" style="padding-top:15px;"><a href="{{url('uslogin')}}">登录后发表回应！</a></div>                
                @endif
                <div style="clear:both;"></div>
                <div class="zscomment-list">
                @foreach($zengshuliuyans as $zengshuliuyan)
                    <div class="comment">
                        <div class="author">
                            <div class="avatar">
                                @if($zengshuliuyan->users->avatar_file_min!="")
                                    <a href="{{url('u/'.$zengshuliuyan->uid)}}" target="_blank"><img src="{{url($zengshuliuyan->users->avatar_file_min)}}"></a>
                                @else
                                    <a href="{{url('u/'.$zengshuliuyan->uid)}}" target="_blank"><img src="http://www.yedushu.com/usersface/default/avatar-min.png"></a>
                                @endif
                            </div>
                        </div>
                        <div class="info">
                            <div class="username"><a href="{{url('u/'.$zengshuliuyan->uid)}}" target="_blank">{{$zengshuliuyan->users->user_name}}</a></div>
                            <div class="time">{{date('Y-m-d H:i',$zengshuliuyan->add_time)}}</div>
                        </div>
                    <div class="comment-wrap">{!!$zengshuliuyan->zsliuyan!!}</div>
                    </div>
                @endforeach
                {!! $zengshuliuyans->render() !!}
                </div>
            </div>
            @include('hangye.include.zsaside')
            <div class="" style="padding-bottom: 10px;clear:both;"></div>
        </div>
    </div>        
    @include('hangye.include.footer')

<script type="text/javascript">
    //实例化编辑器
    var uezsliuyan = UE.getEditor('zsliuyan',{
        wordCount: true, //开启字数统计
        elementPathEnabled: false,//是否启用元素路径，默认是显示
        maximumWords: 150,       //允许的最大字符数
        initialContent: '',    //初始化编辑器的内容,也可以通过textarea/script给值，看官网例子
        autoClearinitialContent: true, //是否自动清除编辑器初始内容，注意：如果focus属性设置为true,这个也为真，那么编辑器一上来就会触发导致初始化的内容看不到了
        pasteplain: true,  //是否默认为纯文本粘贴。false为不使用纯文本粘贴，true为使用纯文本粘贴
        enableContextMenu: false, //关闭右键菜单功能
        //imageUrlPrefix: "http://localhost:4176", /* 图片访问路径前缀 */
        //imagePathFormat: "/UploadFiles/{yyyy}{mm}{dd}/{time}{rand:6}",/* 上传保存路径,可以自定义保存路径和文件名格式 */
        //urlTarget: "Email",
        initialFrameWidth: 752, //初始化宽度
        initialFrameHeight: 80, //初始化高度
        autoHeightEnabled: false, //关闭高度自适应
        enableAutoSave: false //禁止自动保存
        ,toolbars: []
    });

$(document).ready(function(){
    $("#okbutton").click(function(){
        if(!UE.getEditor('zsliuyan').hasContents())
        {
            alert("请输入留言内容。");
            UE.getEditor('zsliuyan').focus();
        }
        else if((UE.getEditor('zsliuyan').getContentTxt()).length>150)
        {
            alert("留言内容不要超过150个字符。");
            UE.getEditor('zsliuyan').focus();
        }
        else
        {
            form.submit();
        }
    });
});
</script>
</body>
</html>

